import { i18n, toI18nName } from 'boot/i18n.js'
import { AGVTypes } from 'src/enum/index.js'
import { dispatchAreaCategory } from 'src/views/MonitorCore/enum.js'

export const formatColumns = (AGVBrands = []) => {
  return [{
    label: `${i18n.t('AGVCore.RuleCode')}`, field: 'ruleCode', minWidth: 80, required: true
  }, {
    label: `${i18n.t('AGVCore.RuleName')}`, field: 'ruleName', required: true, minWidth: 80, topLeft: true
  }, {
    label: `${i18n.t('AGVCore.AGVBrand')}`, field: 'agvBrandCode', type: 'select', options: AGVBrands,
    minWidth: 80, props: { label: `${toI18nName('agvBrandNameZhCn')}`, value: 'agvBrandCode' },
    required: true
  }, {
    label: `${i18n.t('AGVCore.AGVType')}`, field: 'agvTypeCode', type: 'select', options: AGVTypes.value,
    minWidth: 80, required: true
  }, {
    label: `${i18n.t('MapCore.DispatchTaskTemplateCode')}`, field: 'dispatchRcsTaskType', minWidth: 80,
    search: false, required: true
  }, {
    label: `${i18n.t('MapCore.StartArea')}`, field: 'sourceAreaCode', minWidth: 80, search: false,
    required: true, tips: `${i18n.t('MapCore.DispatchAreaTips')}`
  }, {
    label: `${i18n.t('MapCore.StartAreaCategory')}`, field: 'sourceAreaType', type: 'select', minWidth: 80,
    search: false, options: dispatchAreaCategory.value, value: '1', readonly: true, hide: true, required: true
  }, {
    label: `${i18n.t('MapCore.DispatchStartPoint')}`, field: 'dispatchSourcePointName', minWidth: 80,
    search: false, required: true
  }, {
    label: '', field: 'splitLine', formslot: true, hide: true, search: false, export: false, showInfo: false,
    labelWidth: 0, span: 24
  }, {
    label: `${i18n.t('MapCore.TargetArea')}`, field: 'targetAreaCode', minWidth: 80, search: false,
    required: true, tips: `${i18n.t('MapCore.DispatchAreaTips')}`
  }, {
    label: `${i18n.t('MapCore.TargetAreaCategory')}`, field: 'targetAreaType', type: 'select', minWidth: 80,
    search: false, options: dispatchAreaCategory.value, value: '1', readonly: true, hide: true, required: true
  }, {
    label: `${i18n.t('MapCore.DispatchTargetPoint')}`, field: 'dispatchTargetPointName', minWidth: 80,
    search: false, required: true
  }, {
    label: `${i18n.t('MapCore.MinIdleDevicesInTargetArea')}`, field: 'targetMinIdleAgvCnt', minWidth: 80,
    search: false, hide: true, required: true
  }]
}